add cabal-docspec to flake dependencies and include examples for most symbols#170
add cabal-docspec to flake dependencies and include examples for most symbols#170MMesch wants to merge 54 commits intoVinylRecords:masterfrom
Conversation
Currently from the Nix user repo because it is not yet on hackage or nixpkgs
bf5e14c to
bd88680
Compare
|
I am working now on this branch but maybe it'd be better to split the PR up. @acowley let me know what you would prefer. Also, I really don't know what the best solution is to make the Tutorial pass doctests without adding a global dependency on singletons which is a bit annoying. |
|
How would you split it up? |
Unfortunately this requires introducing singletons as dependencies. I don't know how to best solve this.
b0d45cc to
7bb7a30
Compare
|
There are some simple changes such as fixing or adding doctests. And there are some like the singletons version bounds that may be more complex. I pushed a new version with open version bounds but I'm unsure how to sustainably resolve this issue because it's a pity to add a dependency on the main library just for the tutorial. Maybe best would be to keep the tutorial just in tests and then link to it from the haddock page? |
811a702 to
84bbffa
Compare
|
That sounds reasonable regarding |
763b2b5 to
b5a26df
Compare
178761f to
7d294ae
Compare
The alternative is computed as type family not as class. The latter doesn't seem to work.
|
@acowley I think I managed to run all examples, including the existing Tutorial through cabal-docspec without adding singletons as a library dependency (it is added through a dummy doctests target and then exposed through an extra field). I think we could try activating it in CI but that's a bit difficult for me to do without access to it. In theory you should be able to run it with |
|
|
||
| nurpkgs = import nur { | ||
| nurpkgs = nixpkgs.legacyPackages.x86_64-linux; | ||
| pkgs = nixpkgs.legacyPackages.x86_64-linux; |
There was a problem hiding this comment.
This doesn't evaluate on aarch64 systems, and the cabal-docspec in nur seems be downloading a binary.
There was a problem hiding this comment.
Can we build cabal-docspec as a normal Haskell package in our flake?
There was a problem hiding this comment.
That may be possible. Not sure when I'll have the time to play around with that but it seems the easiest path forward. Too bad it isn't on hackage.
|
@acowley , I investigated this a bit and unfortunately it seems more complex to get a cabal-docspec binary for Mac and Windows than what I have time for right now. Wouldn't it be sufficient to just run the doctests on the Linux CI? As opposed to the build, I don't think testing the docs cross platform adds much extra value. And for development on mac, maybe the cabal-docspec Docker container works until there is a proper binary available? |
|
Yes, running only in CI is definitely an option. I was going to take a look at a from source build of |
|
Nothing in particular except for various general comments in the cabal-extras repo on the build process that may indicate complexity. But it's probably more because I'm not super experienced with the Nix Haskell infra, I fear I can't really debug any Macos or Windows builds, and I don't have enough headspace at the moment to dive into that 🙄. I want to mostly add documentation to vinyl and frames and maybe make some smaller improvements since I tried using those more actively recently. I also wonder what the proper way forward is so that we don't duplicate effort that should find it's place upstream. But considering all options (eg hackage doesn't seem to be in sight), I think writing a cross platform flake for cabal-extras seems like the most reasonable thing to do. |
|
Wow, |
|
@acowley , sorry this ready except for running it cleanly in the CI. I think it's a useful addition but I'm a bit blocked on my own. Do you think we can somehow finish it together? |
|
ping @acowley |
This adds
cabal-docspecto the flake dependencies to start addressing https://github.com/VinylRecords/Vinyl/blob/master/vinyl.cabal#L96.It's currently taken from the Nix user repo because it is not yet on hackage or nixpkgs.
Run with
This is the current output summary:
I plan fixing the errors in subsequent PRs, but I thought it'd be nice to have cabal-docspec in already before because there seems to be no possibility to run doctests at the moment whatsoever. And also to keep PR size small.